package com.mmloo.common;

import com.mmloo.common.model.*;
import com.mmloo.common.service.TestService;
import com.mmloo.common.service.UserService;
import com.mmloo.common.util.CommonUtil;
import org.apache.shiro.crypto.hash.Sha512Hash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Date;

/**
 * Created by jessy on 2015/9/24.
 */
@Controller
public class TestController {
    @Autowired
    TestService testService;
    @Autowired
    UserService userService;

    @RequestMapping(value = "/test",method = RequestMethod.GET)
    public String test() throws Exception{
        /*User user = new User();
        user.setUsername("wjs");
        user.setConsume_count("0");
        user.setEmail("123@qq.com");
        user.setMobile("123144");
        user.setPassword(new Sha512Hash("111", "wjs" + "ps", 99).toString());
        user.setRealname("翁嘉思");
        userService.save(user);
        for(int i=2;i<10;i++) {
            User user2 = new User();
            user2.setUsername("wjs"+i);
            user2.setConsume_count("0");
            user2.setEmail(i+"1232@qq.com");
            user2.setMobile("123144");
            user2.setPassword(new Sha512Hash("111", "wjs"+i + "ps", 99).toString());
            user2.setRealname("翁嘉思"+i);
            userService.save(user);
        }*/


        return "home/home";
    }

    public static void main(String[] args){
        Attribute attr = new Attribute();
        attr.setId("1");
        attr.setAttribute("季节");
        attr.setCategory_id("1");/*服装*/
        System.out.println(attr.toJson());
    }
}
